[?php use_stylesheets_for_form($form) ?]
[?php use_javascripts_for_form($form) ?]
<div id="sf_admin_filter" class="sf_admin_filter accordion">
    <div class="accordion-group">
        <div class="accordion-heading">
            <a class="accordion-toggle" data-toggle="collapse" data-parent="#sf_admin_filter" href="#filters">[?php echo __('Filters', array(), 'sf_admin') ?]</a>
        </div>
        <div id="filters" class="accordion-body collapse[?php echo ($hasFilters) ? ' in' : '' ?]">
            <div class="accordion-inner">
                [?php if ($form->hasGlobalErrors()): ?]
                [?php echo $form->renderGlobalErrors() ?]
                [?php endif; ?]
                <form id="sf_admin_filter_form" action="[?php echo url_for('<?php echo $this->getUrlForAction('collection') ?>', array('action' => 'filter')) ?]" method="post">
                    <div class="row-fluid">
                        <div class="span12">
                            <ul class="inline">
                                [?php foreach ($configuration->getFormFilterFields($form) as $name => $field): ?]
                                [?php if ((isset($form[$name]) && $form[$name]->isHidden()) || (!isset($form[$name]) && $field->isReal())) continue ?]
                                [?php include_partial('<?php echo $this->getModuleName() ?>/filters_field', array(
                                'name'       => $name,
                                'attributes' => $field->getConfig('attributes', array()),
                                'label'      => $field->getConfig('label'),
                                'help'       => $field->getConfig('help'),
                                'form'       => $form,
                                'field'      => $field,
                                'class'      => 'sf_admin_form_row sf_admin_'.strtolower($field->getType()).' sf_admin_filter_field_'.$name,
                                )) ?]
                                [?php endforeach; ?]
                            </ul>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span12">
                            [?php echo $form->renderHiddenFields() ?]
                            [?php echo link_to('<i class="icon-refresh"></i>&nbsp;'.__('Reset', array(), 'sf_admin'), '<?php echo $this->getUrlForAction('collection') ?>', array('action' => 'filter'), array('query_string' => '_reset', 'class' => 'btn', 'id' => 'sf_filter_reset')) ?]
                            <button type="submit" class="btn"><i class="icon-filter"></i>&nbsp;[?php echo __('Filter', array(), 'sf_admin') ?]</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
